<?php
$content->assign("formAction", Utils::generateSEOUrl($lang, $section, "save"));

$id = $_GET["id"];

$sql = "SELECT *
		FROM blogComments
		WHERE id = '$id'";

if (!$res1 = $db->runQuery($sql)) {
	$content->assign("error", "Error de MySQL: ".$db->getErrorDescription());
} else {
	if (!$db->getRowCount($res1)) {
		$content->assign("error", "La consulta no ha devuelto resultados.");
	} else {
		$row1 = $db->getRow($res1);
		$entryId = $row1["entryId"];
		foreach ($row1 as $key=>$value) {
			$content->assign($key, utf8_encode($value));
			if ($key == "status") {
				$content->assign("statusInt", $value);
				$content->assign($key, $content->langmsg["blogCommentStatus"][$value]);
			}
			if ($key == "picture" && strlen($value)) {
				$pictureUrl = UPLOADS_URL.$value;
				$pictureThumb = BASE_URL."thumb.php?src=".$pictureUrl."&w=100";
				$content->assign("pictureUrl", $pictureUrl);
				$content->assign("pictureThumb", $pictureThumb);
			}
		}
	}
}

$contentOptions = array(
	0 => array(
		"text" => "Volver",
		"link" => Utils::generateSEOUrl($lang, $section, "list", $entryId),
		"icon" => IMAGES_URL."icons/small/white/Home.png"
	)
);
$content->assign("contentOptions", $contentOptions);
?>
